package com.qqb.service.impl;

import com.qqb.dao.JobDao;
import com.qqb.pojo.Job;
import com.qqb.service.JobService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class JobServiceImpl implements JobService {

    @Resource
    private JobDao jobDao;

    @Override
    public List<Job> findAll() {
        return jobDao.selectAll();
    }

    @Override
    public String findJobNameByCode(String code) {

        Job job = new Job();
        job.setCode(code);
        Job one = jobDao.selectOne(job);
        if (one!=null) {
            return one.getJob();
        }else{
            return "";
        }

    }
}
